home *** CD-ROM | disk | FTP | other *** search
/ Mac Mania 6 / MacMania 6.toast / / Tools&Utilities / EnterAct Stuff / Drag_on Modules / hAWK example progs / $ZeroTest < prev    next >
Text File  |  1994-01-26  |  2KB  |  120 lines

  1. BEGIN {
  2.         print "x un., y = 0, z = \"0\", q = \"\":"
  3.         print "w = 1, u = \"1\";"
  4.         if (x =="" && x == 0)
  5.             print "x not assigned to"
  6.         if (x != 0 || x != "")
  7.             print "x assigned to"
  8.         y = 0
  9.         if (y =="" && y == 0)
  10.             print "y not assigned to"
  11.         if (y != 0 || y != "")
  12.             print "y assigned to"
  13.         z = "0"
  14.         if (z =="" && z == 0)
  15.             print "z not assigned to"
  16.         if (z != 0 || z != "")
  17.             print "z assigned to"
  18.         q = ""
  19.         if (q =="" && q == 0)
  20.             print "q not assigned to"
  21.         if (q != 0 || q != "")
  22.             print "q assigned to"
  23.         w = 1
  24.         if (w =="" && w == 0)
  25.             print "w not assigned to"
  26.         if (w != 0 || w != "")
  27.             print "w assigned to"
  28.         u = "1"
  29.         if (u =="" && u == 0)
  30.             print "u not assigned to"
  31.         if (u != 0 || u != "")
  32.             print "u assigned to"
  33.         afun()
  34.         exit
  35.         print "x is not assigned to"
  36.         if (x == 0)
  37.             print "if (x == 0) works"
  38.         else
  39.             print "x does not compare to 0"
  40.         if (x)
  41.             print "if (x) works"
  42.         if (!x)
  43.             print "if (!x) works"
  44.         if (x == "0")
  45.             print "if (x == \"0\") works"
  46.         if (x == "")
  47.             print "if (x == \"\") works"
  48.         y = 0
  49.         print "y = 0;"
  50.         if (y == 0)
  51.             print "if (y == 0) works"
  52.         else
  53.             print "y does not compare to 0"
  54.         if (y)
  55.             print "if (y) works"
  56.         if (!y)
  57.             print "if (!y) works"
  58.         if (y == "0")
  59.             print "if (y == \"0\") works"
  60.         if (y == "")
  61.             print "if (y == \"\") works"
  62.         z = "0"
  63.         print "z = \"0\";"
  64.         if (z == 0)
  65.             print "if (z == 0) works"
  66.         else
  67.             print "z does not compare to 0"
  68.         if (z)
  69.             print "if (z) works"
  70.         if (!z)
  71.             print "if (!z) works"
  72.         if (z == "0")
  73.             print "if (z == \"0\") works"
  74.         if (z == "")
  75.             print "if (z == \"\") works"
  76.         q = ""
  77.         print "q = \"\";"
  78.         if (q == 0)
  79.             print "if (q == 0) works"
  80.         else
  81.             print "q does not compare to 0"
  82.         if (q)
  83.             print "if (q) works"
  84.         if (!q)
  85.             print "if (!q) works"
  86.         if (q == "0")
  87.             print "if (q == \"0\") works"
  88.         if (q == "")
  89.             print "if (q == \"\") works"
  90.         ##y = ""
  91.         ##z = "0"
  92.         ##if (z == y)
  93.         ##    print "wow"
  94.         ##afun()
  95.         }
  96.  
  97. function afun(        x,y,z,q)
  98.     {
  99.     print "Locals:"
  100.     if (x =="" && x == 0)
  101.         print "x not assigned to"
  102.     if (x != 0 || x != "")
  103.         print "x assigned to"
  104.     y = 0
  105.     if (y =="" && y == 0)
  106.         print "y not assigned to"
  107.     if (y != 0 || y != "")
  108.         print "y assigned to"
  109.     z = "0"
  110.     if (z =="" && z == 0)
  111.         print "z not assigned to"
  112.     if (z != 0 || z != "")
  113.         print "z assigned to"
  114.     q = ""
  115.     if (q =="" && q == 0)
  116.         print "q not assigned to"
  117.     if (q != 0 || q != "")
  118.         print "q assigned to"
  119.     }
  120.